#ifndef DCDC_DATA_H
#define DCDC_DATA_H

#include <QtCore>

//dcdc设备DirectCurrent
class CDcdcData
{
public:
    bool IsCommNormal();
    bool IsCommFault();

    bool IsRunning();
    bool IsStopped();

    bool IsFault();
    bool IsNoFault();

    bool IsAlarm();
    bool IsNoAlarm();

    bool IsOpening();
    bool IsClosed();

    //获取***的显示文本
    QString GetCommStateText();

    void InitToInvalid();
    void InitToZero();
    void InitToValue(quint16 uvalue, float fvalue);

public:
    quint16 m_uCommState;               //6001 通讯状态 0--正常,1-故障
    quint16 m_uRev[99];
    float m_fRev[100];

    //转发的100个UINT16数据
    // quint16 m_uCommState;           //6001 通讯故障 0正常,1故障
    quint16 m_uRunState;            //6002 运行状态 0运行,1停止
    quint16 m_uFaultState;          //6003 故障状态 0正常,1故障
    quint16 m_uAlarmState;          //6004 告警状态 0正常,1告警
    quint16 m_uSwitchState;         //6005 开关机状态 0已开机,1已关机

    quint16 m_uDcWord1;             //6006 直流接入故障字1
    quint16 m_uDcState1;            //6007 直流接入状态1
    quint16 m_uDcFault1;            //6008 直流接入故障1
    quint16 m_uDcAlarm1;            //6009 直流接入告警1

    quint16 m_uDcWord2;             //6010 直流接入故障字2
    quint16 m_uDcState2;            //6011 直流接入状态2
    quint16 m_uDcFault2;            //6012 直流接入故障2
    quint16 m_uDcAlarm2;            //6013 直流接入告警2

    quint16 m_uDcWord3;             //6014 直流接入故障字3
    quint16 m_uDcState3;            //6015 直流接入状态3
    quint16 m_uDcFault3;            //6016 直流接入故障3
    quint16 m_uDcAlarm3;            //6017 直流接入告警3

    quint16 m_uDcWord4;             //6018 直流接入故障字4
    quint16 m_uDcState4;            //6019 直流接入状态4
    quint16 m_uDcFault4;            //6020 直流接入故障4
    quint16 m_uDcAlarm4;            //6021 直流接入告警4

    quint16 m_uDcWord5;             //6022 直流接入故障字5
    quint16 m_uDcState5;            //6023 直流接入状态5
    quint16 m_uDcFault5;            //6024 直流接入故障5
    quint16 m_uDcAlarm5;            //6025 直流接入告警5

    quint16 m_uDcWord6;             //6026 直流接入故障字6
    quint16 m_uDcState6;            //6027 直流接入状态6
    quint16 m_uDcFault6;            //6028 直流接入故障6
    quint16 m_uDcAlarm6;            //6029 直流接入告警6

    quint16 m_uData[72];            //6030~6200 转发的UINT16数据:预留,数组数量=100-上面的转发数

    //转发的100个FLOAT数据
    float m_fTotalEnergy;           //6201 发电量 kwh
    float m_fHighVol;               //6203 高压侧电压 V
    float m_fHighCur;               //6205 高压侧电流 A
    float m_fHighActPower;          //6207 高压侧有功功率 kw
    float m_fInwindTemp;            //6209 进风口温度 ℃
    float m_fOutwindTemp;           //6211 出风口温度 ℃

    float m_fLowVol1;               //6213 低压侧电压1 V
    float m_fLowCur1;               //6215 低压侧电流1 A
    float m_fLowActPower1;          //6217 低压侧有功功率1 kw

    float m_fLowVol2;               //6219 低压侧电压2 V
    float m_fLowCur2;               //6221 低压侧电流2 A
    float m_fLowActPower2;          //6223 低压侧有功功率2 kw

    float m_fLowVol3;               //6225 低压侧电压3 V
    float m_fLowCur3;               //6227 低压侧电流3 A
    float m_fLowActPower3;          //6229 低压侧有功功率3 kw

    float m_fLowVol4;               //6231 低压侧电压4 V
    float m_fLowCur4;               //6233 低压侧电流4 A
    float m_fLowActPower4;          //6235 低压侧有功功率4 kw

    float m_fLowVol5;               //6237 低压侧电压5 V
    float m_fLowCur5;               //6239 低压侧电流5 A
    float m_fLowActPower5;          //6241 低压侧有功功率5 kw

    float m_fLowVol6;               //6243 低压侧电压6 V
    float m_fLowCur6;               //6245 低压侧电流6 A
    float m_fLowActPower6;          //6247 低压侧有功功率6 kw

    float m_fData[76];              //6249~6599 转发的FLOAT数据:预留,数组数量=100-上面的转发数

    // 6001     6200	200	UINT16	200	读DCDC的UNIT16数据	0x03/0x04	无	DCDC数据
    // 6201     6600	400	FLOAT	200	读DCDC的FLOAT数据	0x03/0x04	无
    // 22001	22200	200	UINT16	200	写DCDC的数据	0x03/0x04	0x06

    //22001~22200 设置的数据:预留,数组数量=30-上面的设置数
    quint16 m_uSetData[30];
    quint16 m_uSetDataCopy[30];
};

#endif //DCDC_DATA_H
